package com.example.di;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration(proxyBeanMethods = true)
// @ComponentScan(basePackages = {"com.example.di"})
public class DIConfig {

    @Bean
    public FunctionService functionService() {
        System.out.println("create functionService bean");
        return new FunctionService();
    }

    @Bean // jsr330 jsr250
    public UseFunctionService useFunctionService(FunctionService svc) {
        System.out.println("create useFunctionService bean");
        UseFunctionService srv = new UseFunctionService();
        srv.setFunctionService(svc);
        return srv;
    }
}
